package net.sareweb.acab.session;

import net.sareweb.acab.entity.*;
import org.jboss.seam.annotations.Name;
import org.jboss.seam.framework.EntityQuery;
import java.util.Arrays;

@Name("commentList")
public class CommentList extends EntityQuery<Comment> {

	private static final String EJBQL = "select comment from Comment comment";

	private static final String[] RESTRICTIONS = { "lower(comment.msg) like lower(concat(#{commentList.comment.msg},'%'))", };

	private Comment comment = new Comment();

	public CommentList() {
		setEjbql(EJBQL);
		setRestrictionExpressionStrings(Arrays.asList(RESTRICTIONS));
		setMaxResults(25);
	}

	public Comment getComment() {
		return comment;
	}
}
